/**
 *  Copyright (C) 2006 zhangbo (freeeob@gmail.com)
 *
 *  This product is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation; either version 2.1 of the License, or
 *  (at your option) any later version.
 * 
 *  This product is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 *
 *  author:zhangbo
 *  Email:jsjava@gmail.com
 */

/**
 * constructor
 */ 
function PhotoRevealTransRender(url,duration,transition,userObj){
	this.jsjava_class="jsorg.eob.component.album.PhotoRender";	
	this.url=url;
	this.duration=duration;
	this.transition=transition;
	this.userObj=userObj;
}

PhotoRevealTransRender.prototype=new PhotoRender();
PhotoRevealTransRender.prototype.constructor=PhotoRevealTransRender;

/**
 * Execute the render logic
 * @param imgObj
 */
PhotoRevealTransRender.prototype.execute=function(imgObj){	
	imgObj.filters.revealtrans.apply();
	imgObj.src=this.url;
	imgObj.filters.revealtrans.Transition=this.transition;  
	imgObj.filters.revealtrans.Duration=this.duration;       
    imgObj.filters.revealtrans.play();
    var customRenderMethod=this.getAlbum().getCustomRenderMethod();
    if(customRenderMethod){
    	eval(customRenderMethod+"(this.userObj)");
    }
};

/**
 * Set image url
 * @param url
 */
PhotoRevealTransRender.prototype.setURL=function(url){
	this.url=url;
};

/**
 * Get image url
 */
PhotoRevealTransRender.prototype.getURL=function(){
	return this.url;
};

/**
 * Set render duration
 * @param duration
 */
PhotoRevealTransRender.prototype.setDuration=function(duration){
	this.duration=duration;
};

/**
 * Get render duration
 */
PhotoRevealTransRender.prototype.getDuration=function(){
	return this.duration;
};

/**
 * Set render transition
 * @param transition
 */
PhotoRevealTransRender.prototype.setTransition=function(transition){
	this.transition=transition;
};

/**
 * Get render transition
 */
PhotoRevealTransRender.prototype.getTransition=function(){
	return this.transition;
};

/**
 * Set the belonged album
 * @param album
 */
PhotoRevealTransRender.prototype.setAlbum=function(album){
	this.album=album;
};

/**
 * Get the belonged album
 */
PhotoRevealTransRender.prototype.getAlbum=function(){
	return this.album;
};